The present disclosure relates to storage control devices, electronic apparatuses, storage media, and storage control methods.
In recent electronic apparatuses, such as image forming apparatuses, information processing apparatuses, etc., logging is performed to record, to an area (log area) for storing log information in a random access memory (RAM), information about an operation or state of each functional part included in the apparatus, information indicating the detected value of a sensor included in the apparatus, etc. The term “log” refers to data indicating the history of an operation, state, etc. of a computer or each functional part, i.e., a set of pieces of information (data) related to an operation, state, etc. of a computer or each functional part, which are obtained over time. The term “logging” refers to recording of data to the log area. If such a log is saved, then when a problem or an abnormality occurs in an operation of the apparatus, the log can help a maintenance person to find out a cause for the problem or the abnormality. For example, the maintenance person can find out a cause or background for the problem by analyzing the log which has been recorded before the occurrence of the problem. The log may contain the detected value of a sensor or information about an abnormality in addition to the history.
The memory for saving the log may be configured so that data is written thereto in time series and data stored before the current write time is overwritten. The reason is as follows. Logging is, for example, performed in order to find out a cause for a problem, if any. Therefore, data contained in the log does not have to be permanently stored, and may be stored for a predetermined period of time. Therefore, after the predetermined period of time has passed, data contained in the log may be erased or old data may be overwritten with new data. This may allow the size of the log area to fall within a predetermined value. The memory for saving the log may be, for example, a ring buffer.
A ring buffer is a buffer having a conceptually ring-like structure, that has a storage area which is logically connected end-to-end. Specifically, in a ring buffer, assuming that the leading and trailing ends of the storage area are indicated by addresses A and B, respectively, when the write or read address for the storage area reaches the address B, the next address is the address A. If the storage area is written or read backward, then when the write or read address for the storage area reaches the address A, the next address is the trailing address B.
For example, when a user programmable read only memory (ROM) in which data is erased only in sectors is used as a ring buffer, there is a known technique of erasing data while using sectors efficiently.